package com.threadmethod.productdata;

/**
 * @PackageName:com.threadmethod.productdata
 * @ClassName:ProducerThread
 * @Description: 定义线程类模拟生产者
 * @Author: zhangxiaoyu
 * @date 2021/1/18 14:04
 */
public class ProducerThread extends Thread{

      //生产者生产数据就是调用ValueOP类的setValue方法给value字段赋值
      private ValueOP obj;

    public ProducerThread(ValueOP obj) {
        this.obj = obj;
    }

    @Override
    public void run() {
        while (true){
            obj.setValue();
        }
    }
}
